import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'
import Home from '../views/Home.vue'
import Page from '../views/Page.vue'
import Start from '../views/layout/start.vue'
import Intro from '../views/layout/intro.vue'
import Install from '../views/layout/install.vue'
import SwitchDemo from '../views/component/SwitchDemo.vue'
import DialogDemo from '../views/component/DialogDemo.vue'
import TabDemo from '../views/component/TabDemo.vue'
import StepDemo from '../views/component/StepDemo.vue'
import TagDemo from '../views/component/TagDemo.vue'
import SelectDemo from '../views/component/SelectDemo.vue'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path:'/page',
    name: 'Page',
    component: Page,
    redirect: '/page/start',
    children:[
      {
        path:'start',
        name: 'Start',
        component: Start
      },
      {
        path:'intro',
        name: 'Intro',
        component: Intro
      },
      {
        path:'install',
        name: 'Install',
        component: Install
      },
      {
        path:'switchDemo',
        name: 'SwitchDemo',
        component: SwitchDemo
      },
      {
        path:'dialogDemo',
        name: 'DialogDemo',
        component: DialogDemo
      },
      {
        path:'tabDemo',
        name: 'TabDemo',
        component: TabDemo
      },
      {
        path:'stepDemo',
        name: 'StepDemo',
        component: StepDemo
      }, 
      {
        path:'tagDemo',
        name: 'TagDemo',
        component: TagDemo
      },
      {
        path:'selectDemo',
        name:'SelectDemo',
        component:SelectDemo
      }
    ]
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
